package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.DaibanIngMapper;
import com.aidex.biz.domain.DaibanIng;
import com.aidex.biz.service.DaibanIngService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 待办事项Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-04-17
 */
@Service
@Transactional(readOnly = true)
public class DaibanIngServiceImpl extends BaseServiceImpl<DaibanIngMapper, DaibanIng> implements DaibanIngService
{
    private static final Logger log = LoggerFactory.getLogger(DaibanIngServiceImpl.class);

    /**
     * 获取单条数据
     * @param daibanIng 待办事项
     * @return 待办事项
     */
    @Override
    public DaibanIng get(DaibanIng daibanIng)
    {
        DaibanIng dto = super.get(daibanIng);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 待办事项id
     * @return 待办事项
     */
    @Override
    public DaibanIng get(String id)
    {
        DaibanIng dto = super.get(id);
        return dto;
    }


    /**
     * 查询待办事项列表
     * @param daibanIng 待办事项
     * @return 待办事项
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<DaibanIng> findList(DaibanIng daibanIng)
    {
        return super.findList(daibanIng);
    }

    /**
     * 分页查询待办事项列表
     * @param daibanIng 待办事项
     * @return 待办事项
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<DaibanIng> findPage(DaibanIng daibanIng)
    {
        return super.findPage(daibanIng);
    }

    /**
     * 保存待办事项
     * @param daibanIng
     * @return 结果
     */
    @Override
    public boolean save(DaibanIng daibanIng)
    {
        return super.save(daibanIng);
    }


    /**
     * 删除待办事项信息
     * @param daibanIng
     * @return 结果
     */
    @Override
    public boolean remove(DaibanIng daibanIng)
    {
        return super.remove(daibanIng);
    }

    /**
     * 批量删除待办事项
     * @param ids 需要删除的待办事项ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteDaibanIngByIds(String[] ids)
    {
        return mapper.deleteDaibanIngByIds(ids);
    }

    /**
     * 获取最大编号
     * @param daibanIng 待办事项
     * @return 结果
     */
    @Override
    public int findMaxSort(DaibanIng daibanIng)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(daibanIng));
    }

    @Override
    public int insertBatch(List<DaibanIng> daibanIngs) {
        return mapper.insertBatch(daibanIngs);
    }
}
